/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package reportes;

import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 *
 * @author Luis
 */
public class GestorReportes {
    
    public void agregar(InfoVmps informacion){
        File directorio = new File("C://vmps/");
        if(!directorio.exists()){
            directorio.mkdir();
        }
        try
    	{
            PrintWriter out = new PrintWriter(new FileWriter("C://vmps/BaseDatos.txt"));
            
            out.println("hola comp");
            out.close();
    	}
    	catch (Exception ex)
    	{
            System.out.println("Gestor_Reporte | escribir " + ex);
    	}
    }
    
    public String obtenerUsuIPMAC(){        
        String texto = "";
        if(existeBD()){
        
            Scanner input = new Scanner("BaseDatos.txt");
            while(input.hasNext()){
                String linea = input.nextLine();
                texto += linea + "\r\n";
            }
            input.close(); 
        }
        return texto;
    }
    
    public String obtenerVlans(){        
        String texto = "";
        if(existeBD()){
        
            Scanner input = new Scanner("BaseDatos.txt");
            while(input.hasNext()){
                String linea = input.nextLine();
                texto += linea + "\r\n";
            }
            input.close(); 
        }
        return texto;
    }
    
    public String obtenerTodo(){        
        String texto = "";
        if(existeBD()){
        
            Scanner input = new Scanner("BaseDatos.txt");
            while(input.hasNext()){
                String linea = input.nextLine();
                texto += linea + "\r\n";
            }
            input.close(); 
        }
        return texto;
    }
    
    public boolean existeBD(){
        File bd = new File("C://vmps/BaseDatos.txt");
        return bd.exists();
    }
    
   
    
}
